<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title</title>
    <link href="${request.contextPath}/static/ihomeStatic/css/bootstrap.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/css/font-awesome.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/css/animate.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/css/style.min.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/js/layer/mobile/need/layer.css" rel="stylesheet">
    <link href="${request.contextPath}/static/ihomeStatic/js/treeTable/css/treeTable.min.css" rel="stylesheet">
</head>
<body>
<input type="hidden" id="id" value="${data.id}">
<div class="wrapper white-bg">
    <div class="row">
        <div class="col-lg-12">
            <div class="tab-content">
                <div id="tab-10" class="tab-pane active">
                    <div class="panel-body">
                        <div class="row">
                            <form class="form-horizontal" id="defaultForm" method="post" action="${request.contextPath}/dict/city/provinceForm/save"
                                  onsubmit="return false;">


                                <div class="row">

                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><font color="red">*</font>章节名称:</label>
                                            <div class="col-sm-8"><input type="text" class="form-control required" id="chapterName" name="chapterName" value="${data.chapterName}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><font color="red">*</font>顶部显示名称:</label>
                                            <div class="col-sm-8"><input type="text" class="form-control required" id="titleShowName" name="titleShowName" value="${data.titleShowName}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><font color="red">*</font>科目:</label>
                                            <select id="courseId" name="courseId" class="form-control" style="width: auto">
                                                <#if data1??>
                                                    <#list data1 as d>
                                                        <#if data.courseId==d.id>
                                                            <option value=${d.id} selected>${d.courseName}</option>
                                                        </#if>
                                                        <#if data.courseId!=d.id>
                                                            <option value=${d.id}>${d.courseName}</option>
                                                        </#if>
                                                    </#list>
                                                </#if>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><font color="red">*</font>排序:</label>
                                            <div class="col-sm-8"><input type="text" class="form-control required" id="sort" name="sort" value="${data.sort}">
                                            </div>
                                        </div>
                                    </div>

                                </div>


                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group"><label class="col-sm-2 control-label">备注：</label>

                                            <div class="col-sm-10 width450">
                                                <textarea id="remark" class="form-control" rows="3"><#if data.remark??>${data.remark}</#if></textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                            <button onclick="enter()" class="btn btn-success">确定</button> <button onclick="cancel()" class="btn btn-primary">取消</button></p>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>





    function enter() {

        var id = $("#id").val();
        var chapterName = $("#chapterName").val();
        var titleShowName = $("#titleShowName").val();
        var courseId = $("#courseId option:selected").val();
        var sort = $("#sort").val();
        var remark = $("#remark").val();
        $.ajax({
            url:"${request.contextPath}/chapterManage/update",
            type:"GET",
            data:{id:id,chapterName:chapterName,titleShowName:titleShowName,courseId:courseId,sort:sort,remark:remark},
            success:function (data) {
                if (data.returnCode!=null||data.returnCode!=''){
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.$("#hi2").val("1");
                    parent.layer.close(index);//关闭当前页
                }
            }
        });

    }
    function cancel() {
        parent.$("#hi1").val("2");
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);//关闭当前页
    }

</script>

<script src="${request.contextPath}/static/ihomeStatic/js/jquery-1.12.4.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/bootstrap.min.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/bootstrap-table/bootstrap-table.min.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/layer/layer.js"></script>
<script src="${request.contextPath}/static/ihomeStatic/js/treeTable/js/jquery.treeTable.min.js"></script>
</html>
